// 基于template/src/widgets/{{appEntities}}/{{ctrls@CALENDAR}}-calendar/{{spinalCase ctrl.codeName}}-calendar-model.ts.hbs生成

import { ICalendarModel, ICalendarItemModel } from "@/core";

//  获取日历模型
function getModel(): ICalendarModel {
  return {
    cssName: "",         
    caption: '',
    controlType: 'CALENDAR',
    codeName: 'IBIZBOOKPANEL',
    entityCodeName: 'IBIZBOOK',
    ctrlMsgModel:[
    ],
    entityLogicName: '图书',
    name: 'calendar',
    limit: 1000,
    // 日历项集合
    calendarItems: getCalendarItems(),
    // 日历样式
    calendarStyle: 'TIMELINE',
    // 部件参数
    ctrlParams: {},    
  };
}

function getCalendarItems(): ICalendarItemModel[] {
    return [
      {
        // 项标识
        itemType: 'item1',
        // 上下文菜单
        contextMenus: [
                {
                    name: "deuiaction1",
                    ctrlname: "cm",
                    nodeOwner: "",
                    caption: "保存",
                    showCaption: true,
                    showIcon: true,
                    tooltip: "保存",
                    uiAction: {
                        actionTag: "Save",	
                        actionTarget: "",
                        dataAccessAction: "",
                        noPrivDisplayMode: 2,
                        visible: true,
                        disabled: false,            
                        uIActionMode: "SYS",
                        uIActionType: "DEUIACTION",
                        actionDECodeName: "IBIZBOOK",
                        predefinedType: "EDITVIEW_SAVEACTION",            
                    },        
                    cssClass: "fa fa-save",
                },
                {
                    name: "deuiaction2",
                    ctrlname: "cm",
                    nodeOwner: "",
                    caption: "编辑",
                    showCaption: true,
                    showIcon: true,
                    tooltip: "编辑",
                    uiAction: {
                        actionTag: "Edit",	
                        actionTarget: "SINGLEKEY",
                        dataAccessAction: "",
                        noPrivDisplayMode: 2,
                        visible: true,
                        disabled: false,            
                        uIActionMode: "SYS",
                        uIActionType: "DEUIACTION",
                        actionDECodeName: "IBIZBOOK",
                        predefinedType: "GRIDVIEW_EDITACTION",            
                    },        
                    cssClass: "fa fa-edit",
                },
                {
                    name: "deuiaction3",
                    ctrlname: "cm",
                    nodeOwner: "",
                    caption: "刷新",
                    showCaption: true,
                    showIcon: true,
                    tooltip: "刷新",
                    uiAction: {
                        actionTag: "Refresh",	
                        actionTarget: "SINGLEKEY",
                        dataAccessAction: "",
                        noPrivDisplayMode: 2,
                        visible: true,
                        disabled: false,            
                        uIActionMode: "SYS",
                        uIActionType: "DEUIACTION",
                        actionDECodeName: "IBIZBOOK",
                        predefinedType: "EDITVIEW_REFRESHACTION",            
                    },        
                    cssClass: "fa fa-refresh",
                }
        ],
        // 项实体相关参数
        entityCodeName: 'IBIZBOOK',
        entityLogicName: '图书',
        entityKeyName: 'IBIZBOOKId',     
        // 默认背景颜色
        bKColor: '',   
        // 名称
        name: '图书管理', 
        //  默认文本颜色          
        color: '',
        // 实体数据集对象
        dataSet: {
          codeName : 'FetchDefault',
        },
        // 项标识值应用实体属性
        idField: { codeName: 'ibizbookid' },
        // 实体
        entity: { keyName: 'IBIZBOOKId', codeName: 'ibizbook' },
        // 文本应用实体属性
        textField: { name: 'ibizbookname', codeName: 'ibizbookname' },
        // 开始时间应用实体属性
        beginField: { name: 'lendouttime', codeName: 'lendouttime' },
        // 结束时间应用实体属性
        endField: { name: 'returntime', codeName: 'returntime' },
        // 导航上下文
        navigateContext: {  },
        // 导航参数       
        navigateParams: {  },        
        // 导航过滤项   
        navFilter: '',
        // 导航关系
        navPSDER: {},
        // 样式表
        cssName: '',  
        // 项布局面板
        psLayoutPanel:{
          name: 'item1layoutpanel',
          codeName: 'Auto1',
        },
      }
]

}

export const model = getModel();